package com.zds.passwordbox.fragment;

import android.app.AlertDialog;
import android.app.Dialog;
import android.os.Bundle;
import android.view.LayoutInflater;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment;

import org.apache.commons.lang3.StringUtils;

public class TipDialog  extends DialogFragment {

    private final String message;

    public TipDialog(String message) {
        this.message = message;
    }

    @NonNull
    @Override
    public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
        // Use the Builder class for convenient dialog construction.
        AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
        // Get the layout inflater.
        LayoutInflater inflater = requireActivity().getLayoutInflater();
        //  View view = inflater.inflate(R.layout.private_key_dialog, null);

        builder.setTitle("提示");
        if (StringUtils.isNoneBlank(message)) {
            builder.setMessage(message);
        }
        builder.setPositiveButton("确定", (dialog, id) -> {
        });
        // Create the AlertDialog object and return it.
        return builder.create();
    }
}
